package com.core.utils;

import java.lang.reflect.Field;


public class BeansUtils {
	public static  void copyAttr(Object src,Object dest)
	{
		Field fileds[] = src.getClass().getDeclaredFields();
		for(Field filed:fileds)
		{
			try {
				filed.setAccessible(true);
				Field field_desg = dest.getClass().getDeclaredField(filed.getName());
				if(field_desg!=null)
				{
					field_desg.setAccessible(true);
					
					field_desg.set(dest, filed.get(src));
				}
				
			} catch (SecurityException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (NoSuchFieldException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (IllegalArgumentException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (IllegalAccessException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}

}
